//Validate with regex and output error to defined id
function validateAndOutput(regex, input) {
    var valid = (regex.test(input));
//    if (valid) {
        document.getElementById('logopic_info').value = document.getElementById('logopic').value;
        document.getElementById('logopic').value = "ok";
//    }
    return valid;
}

function validatePicture() {
    return validateAndOutput(/\.(jpg|jpeg|bmp|png)$/, document.getElementById('logopic').value);
}